import 'dart:typed_data';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';
import 'enums/index.dart';
import 'nexgo_method_channel.dart';

abstract class NexgoPlatform extends PlatformInterface {
  /// Constructs a NexgoPlatform.
  NexgoPlatform() : super(token: _token);

  static final Object _token = Object();

  static NexgoPlatform _instance = MethodChannelPrinter();

  /// The default instance of [NexgoPlatform] to use.
  ///
  /// Defaults to [MethodChannelPrinter].
  static NexgoPlatform get instance => _instance;

  /// Platform-specific implementations should set this with their own
  /// platform-specific class that extends [NexgoPlatform] when
  /// they register themselves.
  static set instance(NexgoPlatform instance) {
    PlatformInterface.verifyToken(instance, _token);
    _instance = instance;
  }

  Future<bool> init() {
    throw UnimplementedError('init has not been implemented.');
  }

  Future<bool> printText({
    required String text,
    NexgoAlignEnum align = NexgoAlignEnum.left,
  }) {
    throw UnimplementedError('printText has not been implemented.');
  }

  Future<bool> feed({
    required int val,
  }) {
    throw UnimplementedError('feed has not been implemented.');
  }

  Future<bool> printImage({
    required Uint8List image,
    NexgoAlignEnum align = NexgoAlignEnum.left,
  }) {
    throw UnimplementedError('printImage has not been implemented.');
  }

  Future<bool> setLED({
    required NexgoLightModeEnum light,
    bool enbeld = true,
  }) {
    throw UnimplementedError('setLED has not been implemented.');
  }
}
